﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace Pc_Vision.View_Datalayer_Site
{
    public partial class viewDataLayerProductSite : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void fn_GetProduct(object sender, EventArgs e)
        {
            DAOFactorys.DAOproduct daoProduct = new DAOFactorys.DAOproduct();
            ArrayList result = daoProduct.GetProduct();

            foreach (Model.Product product in result)
            {
                productName.Text = product.name;
                articleNumber.Text = product.articleNumber;
                productDescription.Text = product.productDescription;
                systemType.Text = product.systemType;
                processor.Text = product.processor;
                memory.Text = product.memory;
                storage.Text = product.storage;
                opticalDisk.Text = product.opticalDisk;
                display.Text = product.display;
                videoCard.Text = product.videoCard;
                networkCard.Text = product.networkCard;
                battery.Text = product.battery;
                dimension.Text = product.dimension;
                weight.Text = product.weight;
                warranty.Text = product.warranty;
                inStock.Text = product.inStock;
                sellPrice.Text = product.sellPrice;

            }
        }

        public void fn_GetCategories(object sender, EventArgs e)
        {

            DAOFactorys.DAOcategorie daoCat = new DAOFactorys.DAOcategorie();
            ArrayList result = daoCat.GetAllCategories();


            string li = "";
            foreach (Model.Categorie cat in result)
            {
                li += "<li><a href='#'>" + cat.categorieName +"</a></li>";
            }
            lblProductValue.Text = li;
        }

        public void fn_GetActies(object sender, EventArgs e)
        {
            DAOFactorys.DAOactie daoActie = new DAOFactorys.DAOactie();
            ArrayList result = daoActie.GetAllActies();

            string li = "";

            foreach (Model.Actie actie in result)
            {
                li += "<li><a href='#'>" + actie.actieNaam + "</a></li>";
            }
            lblActieValue.Text = li;
        }

        public void fn_GetProductFromCategorie(object sender, EventArgs e)
        {
            DAOFactorys.DAOproduct daoProduct = new DAOFactorys.DAOproduct();


        }

        }
    }
